import { defineComponent ,getCurrentInstance} from 'vue';
import './App.css'
import logo from "./assets/logo.png";

export default defineComponent({
    setup() {
        const _this:any = getCurrentInstance()
        const routeObj = _this.appContext.app.config.globalProperties
        return () => (
            <>
                <img alt="Vue logo" src={logo} onClick={()=>{
                    let pushPath:String;
                    if(routeObj.$route.path == '/b'){
                        pushPath = '/a'
                    }else {
                        pushPath = '/b'
                    }
                    console.log(pushPath)
                    routeObj.$router.push(pushPath)
                }} />
                <router-view></router-view>
            </>
        );
    },

});



